﻿using System;
using System.Collections.Generic;
using System.Text;
using LoginServer.Converter;
using Common;

namespace LoginServer
{
    public partial class ManagerUserConnection
    {
        void Process_L_CreateTable(object[] param)
        {
            User user = convert_data.GetUserConnection(param);
            int RoomID = 0;
            convert_data.ConvertReceive_L_CreateTable(ref RoomID, param);
            login_server.CreatTable(user.User_ID, RoomID);
        }
        void Process_L_JoinTable(object[] param)
        {
            User user = convert_data.GetUserConnection(param);
            int TableID = 0;
            convert_data.ConvertReceive_L_JoinTable(ref TableID,param);
            login_server.JoinTable(user.User_ID, TableID);
        }
        void Process_L_OutTable(object[] param)
        {
            User user = convert_data.GetUserConnection(param);
            int TableID = 0;
            convert_data.ConvertReceive_L_OutTable(ref TableID, param);
            login_server.OutTable(user.User_ID, TableID);
        }
        void Process_L_CreateRoom(object[] param)
        {
            User user = convert_data.GetUserConnection(param);
            int ServerID = -1;
            string RoomName = null;
            convert_data.ConvertReceive_L_CreateRoom(ref RoomName, param);
            login_server.CreateRoom(user.User_ID, ServerID, RoomName);
        }
        void Process_L_JoinRoom(object[] param)
        {
            User user = convert_data.GetUserConnection(param);
            int RoomID = 0;
            convert_data.ConvertReceive_L_JoinRoom(ref RoomID, param);
            login_server.JoinRoom(user.User_ID, RoomID);
        }
        void Process_L_JoinRoomF(object[] param)
        {
            User user = convert_data.GetUserConnection(param);
            int UserCreateID = 0;
            convert_data.ConvertReceive_L_JoinRoomF(ref UserCreateID, param);
            login_server.JoinRoomF(user.User_ID, UserCreateID);
        }
        void Process_L_OutRoom(object[] param)
        {
            User user = convert_data.GetUserConnection(param);
            int RoomID = 0;
            convert_data.ConvertReceive_L_OutRoom(ref RoomID, param);
            login_server.OutRoom(user.User_ID, RoomID);
        }
    }
}
